clc;
close all;

%filter
averaging = ones(3)/9;

%image
image = imread('lena.pgm');
noisy = imnoise(image, 'salt & pepper', 0.05);
medianFiltered = medfilt2(noisy, [3,3]);
averagingFiltered = imfilter(denoised, averaging, 'conv');

subplot(2,2,1);
imshow(image);
title('Originale');

subplot(2,2,2);
imshow(noisy);
title('Bruitage poivre & sel');

subplot(2,2,3);
imshow(medianFiltered);
title('Debruitee');

subplot(2,2,4);
imshow(averagingFiltered);
title('Debruitee + filtre moyenneur');

